<div class="import">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>重点工作确认</span>
                </h3>
                <span class="m-section__sub">
                    <!-- {{"OrganizationUnitsHeaderInfo" | localize}} -->
                </span>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="ui-g">
            <!-- 左侧 -->
            <div class="ui-g-4 media_item">
                <!-- 顶部搜索 -->
                <div class="ui-g">
                    <div class="ui-g-5">
                        <!-- 型号 -->
                        <span style="margin-right:5px;">型号：</span>
                        <p-dropdown [options]="modelOptions" [(ngModel)]="model" name="model" filter="true"
                            placeholder="请选择型号" emptyFilterMessage="暂无数据" (onChange)="onChange($event)">
                            <ng-template let-item pTemplate="selectedItem">
                                <span style="vertical-align:middle; margin-left: .3em">{{item.label}}</span>
                            </ng-template>
                            <ng-template let-model pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px">{{model.label}}</div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </div>
                    <div class="ui-g-5">
                        <!-- 发次 -->
                        <span style="margin-right: 5px;">发次：</span>
                        <p-dropdown [options]="sendTimeOptions" [(ngModel)]="sendTime" filter="true" placeholder="请选择发次"
                            emptyFilterMessage="暂无数据">
                            <ng-template let-item pTemplate="selectedItem">
                                <span style="vertical-align:middle; margin-left: .3em">{{item.label}}</span>
                            </ng-template>
                            <ng-template let-fc pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px">{{fc.label}}</div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </div>
                    <!-- 搜索 -->
                    <div class="ui-g-2">
                        <p-button label="搜索" (onClick)="treeSearch()"></p-button>
                    </div>
                </div>
                <!-- 树型结构 -->
                <div style="height:680px">
                    <p-tree [value]="treeData" selectionMode="single" [(selection)]="selectedFiles"
                        (onNodeSelect)="nodeSelect($event)" [loading]="loadingtree" [style]="{ height: '95%' }">
                        <ng-template let-node pTemplate="default">
                            <img class="imgcontent"
                                [src]="(node.nodeLevel==8||node.nodeLevel==9)?'../../../assets/common/images/三级图标.png':node.isLeaf==1?'../../../assets/common/images/二级图标.png':'../../../assets/common/images/一级图标.png'"
                                width="20" height="20" />
                            <span
                                *ngIf="node.key==-1">{{node.model}}-{{node.lotNo}}-{{node.nodeDrawingNo}}-{{node.nodeName}}-{{node.stageSign}}</span>
                            <span *ngIf="node.key!=-1">{{node.nodeDrawingNo}}-{{node.nodeName}}</span>
                            <span class="ptagisExport" *ngIf="node.isReturn==1">{{node.isReturn==1?'已回传':''}}</span>
                        </ng-template>
                    </p-tree>
                </div>
            </div>

            <div class="ui-g-7 media_item">
                <div>
                    <form [ngStyle]="{'margin-top': '9px'}">
                        <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid">
                            <div class="ui-grid-col-1" style="margin-left: 30px;margin-top: 30px;">
                                查询属性:
                            </div>
                            <div class="ui-grid-col-2" style="margin-top: 20px;">
                                <p-dropdown name="propty" [options]="proptyOptions" [(ngModel)]="propty" filter="true" placeholder="请选择"
                                    emptyFilterMessage="暂无数据">
                                    <ng-template let-item pTemplate="selectedItem">
                                        <span style="vertical-align:middle; margin-left: .3em">{{item.label}}</span>
                                    </ng-template>
                                    <ng-template let-fc pTemplate="item">
                                        <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                            <div style="font-size:14px;float:right;margin-top:4px">{{fc.label}}</div>
                                        </div>
                                    </ng-template>
                                </p-dropdown>
                            </div>
                            <div class="ui-grid-col-1" style="margin-top: 30px;margin-left: 30px;">
                                 工步完成日期:
                            </div>
                            <div class="ui-grid-col-3" style="margin-top: 20px;">
                                <p-calendar dateFormat="yy-mm-dd" name="rangeDates" [(ngModel)]="rangeDates" selectionMode="range"
                                [showIcon]="true" [locale]="chinese"></p-calendar>
                            </div>
                            <div class="ui-grid-col-3" style="margin-left: 50px;margin-top: 20px;">
                                <p-button label="搜索" (onClick)="searchRight()" style="margin-right: 30px;">
                                </p-button>
                                <p-button label="重置" (onClick)="resert()" style="margin-right: 30px;"></p-button>
                                <p-button *ngIf="'Pages.ConfirmationWork.Export' | permission" label="导出" (onClick)="exprot()"></p-button>
                            </div>
                        </div>
                    </form>

                    <div class="m-portlet__body ui-g-12" style="height: 500px;">

                        <div class="primeng-datatable-container processlabel">
                            <p-table #dataTable [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 50px">序号</th>
                                    <th style="width: 150px">规程编号</th>
                                    <th style="width: 150px">规程名称</th>
                                    <th style="width: 150px">工序号</th>
                                    <th style="width: 150px">工序名称</th>
                                    <th style="width: 150px">工序属性</th>
                                    <th style="width: 150px">工步号</th>
                                    <th style="width: 150px">工步属性</th>
                                    <th style="width: 150px">工步完成日期</th>
                                    <th style="width: 150px">查看路径</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                                <tr>
                                    <td style="width: 50px">{{rowIndex+1}}</td>
                                    <td style="width: 150px">{{record.techniqueNumber}}</td>
                                    <td style="width: 150px">{{record.techniqueName}}</td>
                                    <td style="width: 150px">{{record.processesSequenceDesc}}</td>
                                    <td style="width: 150px">{{record.processesName}}</td>
                                    <td style="width: 150px">{{record.processesCharacteristic}}</td>
                                    <td style="width: 150px">{{record.workStepNumberDesc}}</td>
                                    <td style="width: 150px">{{record.workStepCharacteristic}}</td>
                                    <td style="width: 150px">{{record.thirdOperatorData | momentFormat:'YYYY-MM-DD'}}</td>
                                    <td style="width: 150px"><span style="color: blue;cursor:pointer"
                                        (click)="showUrlInfo(record)">
                                        {{record.route}}
                                    </span></td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="searchRight($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 点击路径查看信息 -->
    <look-path #path [detail]="rowData"></look-path>
</div>